<?php
/*
 * To show the send emails record
 * 
 */
require_once BaseUtil::getModulePath("base")  .  '/controllers/BaseController.php';
require_once BaseUtil::getModulePath('dbgrid') . '/DBGrid.php';
require_once BaseUtil::getModulePath ("systemlog") . '/services/EmailLogService.php';

class SystemLog_EmaillogController extends BaseController {
    public function init() {
        parent::init();
    }
    
    public function indexAction(){
    	$emailLogService = new EmailLogService();
		$emailLogs = $emailLogService->getEmailLog($this->view,$_POST);
		$this->view->emailLogs = $emailLogs;
    }
    
    public function viewAction(){
    	$id = $this->_getParam("id");
    	$emailLogService = new EmailLogService();
    	$emailLog = $emailLogService->getEmailLogById($id);
    	$this->view->emailLog = $emailLog;
    	$this->view->id = $id;
    }
    
    public function deleteAction(){
        $id = $this->_getParam('id');
        $emailLogService = new EmailLogService();
        $emailLogService->deleteEmailLog($id);
        $this->_redirector->gotoUrl('systemlog/emaillog');
    }
}